package com.ittony.blog.mapper;

import com.ittony.blog.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;


@Mapper
public interface CommentMapper {

    int deleteById(Integer commentId);

    int insert(Comment comment);

    Comment getCommentById(Integer commentId);

    int update(Comment comment);

    List<Comment> listCommentByArticleId(@Param(value = "id") Integer id);

    List<Comment> listComment(HashMap<String, Object> criteria);

    List<Comment> getReceiveComment(List<Integer> articleIds);

    Integer countComment();

    List<Comment> listRecentComment(@Param(value = "userId") Integer userId,@Param(value = "limit") Integer limit);

    List<Comment> listChildComment(@Param(value = "id") Integer id);

    Integer deleteByUserId(Integer userId);

    Integer deleteByArticleId(Integer articleId);


}
